package cn.jcby.app.lebu.utils;

import cn.jcby.app.filter.dto.LocalUserDTO;
import lombok.extern.slf4j.Slf4j;

/**
 * @author: lihaotian
 * @since: 2023/12/8 01:11
 * @description
 **/
@Slf4j
public class UserInfoUtil {

    public UserInfoUtil() {
    }

    public static String getUserId() {
        LocalUserDTO user = SpringSecurityUtils.getCurrentUser();
        return user == null ? "" : user.getUserId();
    }

    public static String getMobile() {
        LocalUserDTO user = SpringSecurityUtils.getCurrentUser();
        return user == null ? "" : user.getMobile();
    }

    public static String getInviteCode() {
        LocalUserDTO user = SpringSecurityUtils.getCurrentUser();
        return user == null? "" : user.getInviteCode();
    }
}
